From 6eb5b184728e814f02ff708834fdd6f3cace22bc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 18 Feb 2009 04:35:02 +0000 Subject: [PATCH] (mail-mbox-from): Move here from rmailout.el. --- lisp/mail/mail-utils.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index 9c607cb4f4c..e988cba7073 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el @@ -386,6 +386,20 @@ matches may be returned from the message body." (substring s (match-beginning 3) (match-end 3)) " " (mail-rfc822-time-zone time)))) +(defun mail-mbox-from () + "Return an mbox \"From \" line for the current message. +The buffer should be narrowed to just the header." + (let ((from (or (mail-fetch-field "from") + (mail-fetch-field "really-from") + (mail-fetch-field "sender") + "unknown")) + (date (mail-fetch-field "date"))) + (format "From %s %s\n" (mail-strip-quoted-names from) + (or (and date + (ignore-errors + (current-time-string (date-to-time date)))) + (current-time-string))))) + (provide 'mail-utils) ;; arch-tag: b24aec2f-fd65-4ceb-9e39-3cc2827036fd -- 2.30.2